
import java.util.Scanner;
public class D232 {

            public static void main(String[] args) {
                Scanner jp = new Scanner(System.in);
                boolean dui=true;
                haha:
                //第一层循环
                while (dui){
//输入正常的运算三要素
                    System.out.println("请输入第一个数：");
                    double diyi=jp.nextDouble();
                    System.out.println("请输入运算符（+,-,*,/）");
                    String yunsuan=jp.next();
                    System.out.println("请输入第二个数：");
                    double dier=jp.nextDouble();
//循环加减乘除
                    switch (yunsuan){
                        case "+":
                            //加法运算
                            if(yunsuan.equals("+")){
                                System.out.println(diyi+"+"+dier+"="+(diyi+dier));
                            }
                            break ;
                        case "-":
                            //减法运算
                            if(yunsuan.equals("-")){
                                System.out.println(diyi+"-"+dier+"="+(diyi-dier));
                            }
                            break ;
                        case "*":
                            //乘法运算
                            //乘法不能乘以0
                            if(yunsuan.equals("*")){
                                System.out.println(diyi+"*"+dier+"="+(diyi*dier));
                            }else if(dier==0||diyi==0){
                                System.out.println(diyi+"*"+dier+"=0");
                            }
                        case "/":
                            if(yunsuan.equals("/")){
                                //除法运算
                                //除法不能除o
                                if(dier==0||diyi==0){
                                    System.out.println("除数不能为零请重新输入：");

                                } else{
                                    System.out.println(diyi+"/"+dier+"="+(diyi/dier));
                                }

                            }
                            //结束算术运算
                            break ;
                        default:
                            System.out.println("运算符不对！");
                            break;
                    }
//最终结束语句
                    System.out.println("请问还继续运算吗？");
                    String tui= jp.next();
                    if(tui.equals("exit")){
                        System.out.println("程序退出");
                        break haha;
                    }
                }

            }
        }

